<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">

	<ui:define name="content">
	<h:form>
			<h:outputText value="Czy chcesz wypożyczyć tę książkę?"/>
			<br/>
			
			<h:dataTable value="#{loanBean.itemList}" var="item"
				bgcolor="#F1F1F1" border="2" width="50%">

				<h:column>
					<f:facet name="header">Tytuł </f:facet>
					<h:outputText value="#{item.book.title}" />
				</h:column>

				<h:column>
					<f:facet name="header">Autor</f:facet>
					<h:outputText value="#{item.book.author}" />
				</h:column>

				<h:column>
					<f:facet name="header">Wydawnictwo </f:facet>
					<h:outputText value="#{item.book.publisher}" />
				</h:column>

				<h:column>
					<f:facet name="header">Rok wydania </f:facet>
					<h:outputText value="#{item.book.publicationYear}" />
				</h:column>

				<h:column>
					<f:facet name="header">Kategorie </f:facet>
					<h:outputText value="#{item.book.categories}" />
				</h:column>
			</h:dataTable> 
			<h:outputText value="#{item.book.author}"/>
			<h:commandButton value="Wypożycz" action="#{loanBean.borrow}"/>
			<br/>
			<h:commandButton value="Wróć" action="#{loanBean.back}"/>
		</h:form>
	</ui:define>

</ui:composition>
</html>